jQuery(document).ready(function() {
	
	/** jQuery textarea resizer plugin usage on textareas */
	jQuery('textarea.resizable:not(.processed)').TextAreaResizer();
	jQuery('iframe.resizable:not(.processed)').TextAreaResizer();

	/** Toggle sliding of fieldset containers */
	jQuery('fieldset legend.toggle').click(function() {
		jQuery(this).siblings('.container:first').slideToggle();
		jQuery(this).toggleClass('closed');
	});

	/** Check text length of text submitted to textarea */
	jQuery('#parser').submit(function() {
		var stringlength = (jQuery('#original').val()).length;
		if (stringlength > 100000) {
			alert(
				"Character length must not exceed 100,000 characters "
				+ "(about 35 pages of 12 point font in MSWord)."
				+ "\nConsider parsing your document in chunks."
				);
			return false;
		} else if (stringlength < 1) {
			alert("The textarea is empty.");
			return false;
			
		}
	});

});